#pragma once

#include	<cstdint>

#pragma pack(push, 1)
union ItemId {
	uint32_t	id;
	struct {
		int	genre : 8;
		int	detail : 8;
		int	particular : 8;
		int	level : 8;
	};

	ItemId(uint32_t template_id) : id(template_id) {};
	ItemId(int g, int d, int p, int l)
		: genre(g & 0xFF)
		, detail(d & 0xFF)
		, particular(p & 0xFF)
		, level(l & 0xFF) {
	}

	operator const char *() const;
};
#pragma pack(pop)